package com.interview.item.javabase.session;

import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Map;

/**
 * @Author:zxh
 * @Description:
 * @Date: 2020/4/3
 * @Modified By:
 */
public class SessionUtils {

    @Autowired
    static HttpServletRequest request;

    public static String getSessionId() {
        HttpSession session = request.getSession();
        return session.getId();
    }

    public static String setMapToSession(String sessionId, Map map) {
        HttpSession session = request.getSession();
        return session.getId();
    }

}
